<!DOCTYPE html>
<html lang="en">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

    <title>直播间</title>

    <meta name="keywords" content="上金理财，股市，股票，黄金，白银，期货，外汇，理财，投资，行情，独家，在线直播，直播，直播室，直播间">
    <meta name="description"
          content="上金理财，中国最大，投资者交流，理财平台，券商分析师，民间投资高手，各路专家，为投资者提供全面、及时、到位的投资服务，并与高手一起把脉市场上投资理财产品，向你推荐，让你的财富实现更快、更安全的增值。">
    <link href="/center/favicon.ico" REL="shortcut icon" />
    <link href="index/reset.css" rel="stylesheet" type="text/css">
    <link href="index/function.css" rel="stylesheet" type="text/css">
    <link href="index/style.css" rel="stylesheet" type="text/css">
    <script src="index/hm.js"></script>
    <script type="text/javascript" src="index/jquery.min.js"></script>

    <!--<link rel="stylesheet" href="index/layer.css" id="layui_layer_skinlayercss">-->
    <script type="text/javascript" src="index/validform_v5.3.2_min.js"></script>
    <script type="text/javascript" src="index/jquery.cookie.js"></script>
    <script type="text/javascript" src="index/common.js"></script>
    <script src="/center/layer.js"></script>
    <script src="/gotye/js/model/live.play.js"></script>

    <link rel="stylesheet" type="text/css" href="/template/ue-content/templates/images/style.css" />
    <link rel="stylesheet" type="text/css" href="/template/ue-content/templates/css/style.css" />
    <script src="http://www.jq22.com/jquery/1.7.2/jquery.min.js"></script>
    <script language="javascript" src="/script/jquery.easing.min.js"></script>
    <script language="javascript" src="/script/custom.js"></script>

</head>
<body>
<div class="clear"></div>
<div class="loginmask"></div>
<div id="loginalert" style="top:50px;">
    <div class="pd20 loginpd">
        <h3>
            <i class="closealert fr"></i>
            <div class="clear"></div>
        </h3>
        <div class="loginwrap">
            <div class="loginh">
                <div class="fl">会员登录</div>
                <div class="fr">还没有账号<a id="sigup_now" href="/register/register.html" target="_blank">立即注册</a></div>
                <div class="clear"></div>
            </div>
            <h3>
                <span></span>

                <div class="clear"></div>
            </h3>
            <div class="clear"></div>
            <form id="sign">
                <div class="logininput">
                    <input type="text" name="mobile" class="loginusername" value="用户名" />
                    <input type="text" class="loginuserpasswordt" value="密码" />
                    <input type="password" name="password" class="loginuserpasswordp" style="display:none" />
                </div>
                <div class="loginbtn">
                    <div class="loginsubmit fl">
                        <input type="button" id="loginBut" value="登录" />
                        <div class="loginsubmiting">
                            <div class="loginsubmiting_inner"></div>
                        </div>
                    </div>
                    <div class="logcheckbox fl">
                        <!--<input id="bcdl" type="checkbox" checked="true" />
                        保持登录-->
                        <span class="login_warning" style="margin-left: 10px; margin-top: 25px;">用户名或密码错误</span>
                    </div>
                    <div class="fr"><a href="/register/forget_pass.html" class="c-blue" target="_blank">忘记密码?</a></div>
                    <div class="clear"></div>
                </div>
            </form>
        </div>
    </div>
</div>
<style>
    .c-blue{color:#1997d7;}.c-blueq{color:#3aabe4;}.c-blued{color:#3c6173;}.c-blueh{color:#2c8abe;}.c-blues{ color:#6ba5c2;}
    a.c-blue:hover{ color:#ff7d27; text-decoration:underline;}
    .my-header {
        background-color: #f5f5f5;
    }

    .my-header a:hover {
        color: #D94432;
    }

    .my-header-list > a {
        padding: 0 10px;
        line-height: 36px;
    }

    .my-header-list > a > img {
        vertical-align: middle;
        margin: 0 4px;
    }

    .my-header-list .list-first {
        position: relative;
        margin-left: -10px;
        z-index: 10
    }

    .my-header-list .hover {
        display: block;
        background: #fff;
        border-left: 1px solid #eee;
        border-right: 1px solid #eee;
    }

    .my-header-list .list-last {
        padding-right: 0;
    }

    .my-userInfo-showOut {
        position: absolute;
        left: -10px;
        top: 35px;
        background: #fff;
        z-index: 9;
        padding: 10px;
        border: 1px solid #eee;
        box-shadow: 0 1px 2px #eee;
        display: none;
    }

    .my-user-settings .img-warp {
        width: 75px;
        height: 75px;
        overflow: hidden;
    }

    .my-user-settings .img-warp img {
        width: 100%;
        height: 100%;
    }

    .my-user-settings-cnt {
        width: 140px;
    }

    .my-button-wrap {
        margin-top: 5px;
        padding: 5px 0;
        border-top: 1px solid #eee;
    }

    .my-button-wrap a:hover {
        color: #fff;
    }

    .my-header-cz {
        width: 50px
    }

    .my-header-sq {
        width: 112px
    }

</style>

<script>
    
    function compareDate(updateTime) {
        var myDate = new Date();
        var month = myDate.getMonth() + 1;
        if (month >= 1 && month <= 9) {
            month = "0" + month;
        }
        var year = myDate.getFullYear()+"-"+month+"-"+myDate.getDate();    //获取完整的年份(4位,1970-????)
        if(updateTime != null){
            if(updateTime.substring(0, 10) == year){
                return "正在直播";
            }
        }
        return "暂无直播";
    }
    
    $(document).ready(function(){
        var users = Tool.getCookie("users");
        if(users != null){
            var obj = JSON.parse(users);
            var temp = JSON.parse(obj);
            $.ajax({
                type: "GET",
                url:"/user/"+temp.id+"/findOne",
                success: function(msg) {
                    if(msg.status == 200){
                        $('#loginV').html('');
                        var username = '<a target="_blank" href="" class="list-first f-cl1">'+msg.data.nickname+'</a>';
                        if(msg.data.mobile == "admin"){
                            var center = '<a target="_blank" href="/member/admin.html" class=""><u>个人管理中心</u></a>';
                        }else {
                            var center = '<a target="_blank" href="/member/center.html" class=""><u>个人管理中心</u></a>';
                        }
                        var quit = '<a href="" onclick="logout();" class="">退出</a>';
                        $('#loginV').html(username + center + quit);
                    }else {
//                        layer.msg("登录超时,请重新登录！", {
//                            time: 3000
//                        }, function () {
//                            window.location.href='/index.html';
//                            location.reload();
//                        });
                    }
                },
                error: function(error){alert(error);}
            });
        }
        
        $.ajax({
            type: "GET",
            url:"/anchor",
            data:{'status':1},
            success: function(msg) {
                if(msg.totalElements > 0){
                    var temp = '';
                    $.each(msg.content, function(i, item){
                        var roomNO = "live/"+item.roomNo+"?index="+item.id+"&uid="+item.user.id;
                        var avatar = item.user.avatar;
                        if(avatar == null){
                            avatar = "/center/default-avatar.jpg";
                        }

                        var status = compareDate(item.updateTime);

                        temp += '<div class="rank-list-con-item f-cb">'+
                                '<a href="'+roomNO+'">'+
                                '<div class="rank-list-con-item-1">'+
                                '<img src="'+avatar+'">'+
                                '<p class="rank-list-con-name">' +
                                '<span>'+item.liveClassify.title+'</span>' +
                                '<i class="f-cl2">'+item.user.nickname+'</i>' +
                                '</p>'+
                                '<div class="rank-list-con-des">'+item.profile+'</div>'+
                                '</div>'+
                                '<div class="rank-list-con-item-2">'+
                                '<i class="f-fs14 f-cl2">'+item.roomName+'</i>'+
                                '</div>'+
                                '<div class="rank-list-con-item-3">'+
                                '<p class="f-mt20" style="margin-left: 40px;"><span class="f-cl1 f-fs20">'+status+'</span></p>'+
                                '</div>'+
                                '</a>'+
                                '</div>';
                    });
                    $('#liveList').html(temp);
                }else {
                    $('#liveList').html('<div>' +
                            '<img src="/room_files/LiveEnd.png" alt="" style="    float: left;margin-bottom: 60px;margin-left: 40px;margin-top: 120px">' +
                            '<p style="color: #999;float: left;font-size: 30px;line-height: 55px;margin-left: 20px; margin-top: 190px;">主播还在赶往直播室的路上，<br> 请稍后再来~</p>' +
                            '</div>');
                }
            },
            error: function(error){alert(error);}
        });

        $('#loginBut').click(function(){
            $.ajax({
                type: "POST",
                url:"/user/sign",
                data:$('#sign').serialize(),// 要提交的表单
                success: function(msg) {
                    if(msg.status == 200){
                        window.location.href='/index.html';
                    }else {
                        $('.login_warning').show();
                    }
                },
                error: function(error){alert(error);}
            });
        });
    });

    function logout() {
        $.ajax({
            type: "GET",
            url:"/user/logout",
            success: function(msg) {
                if(msg.status == 200){
                    layer.msg("成功退出！", {
                        time: 1000
                    }, function () {
                        window.location.href='/index.html';
                    });
                }
            },
            error: function(error){
            }
        });
    }
</script>
<!--<div class="my-header">
    <div class="g-doc f-cb">
        <div class="f-fr my-header-list" id="loginV">
            <a class="openlogin" href="" onclick="return false;" class="list-first">登录</a><a target="_blank" href="/register/register.html">免费注册</a>
        </div>
    </div>
</div>-->
<div class="head-nav">
    <div class="g-doc">
        <div class="g-doc f-cb">
            <div class="f-fr my-header-list" id="loginV">
                <a class="openlogin" href="" onclick="return false;" class="list-first">登录</a><a target="_blank" href="/register/register.html">免费注册</a>
            </div>
        </div>
        <ul class="head-nav-list f-cb" style="margin-top: -38px;">
            <li>
                <img src="index/foot-logo.png" alt="">
            </li>
            <li><a target="_blank" href="/index.html" class="cur" style="line-height: 73px; margin-left: 15px;">直播</a></li>
        </ul>
    </div>
</div>
<style>
    .stock-match {
        position: relative;
        bottom: 22px;
        left: 0;
    }
</style>

<div class="rank-list">
    <div class="g-doc f-cb">
        <div class="rank-list-nav" style="height: 100%;">
            <h2>分类</h2>

            <div class="rank-list-nav-item cur">
                <a href="index.html">
                    <em class="f-ti pic1">全部</em>
                    <span>全部直播</span>
                </a>
            </div>

            <div class="rank-list-nav-item">
                <a href="stock.html">
                    <em class="f-ti pic2">股票</em>
                    <span>股票</span>
                </a>
            </div>

            <div class="rank-list-nav-item">
                <a href="gold.html">
                    <em class="f-ti pic3">黄金</em>
                    <span>黄金</span>
                </a>
            </div>

            <div class="rank-list-nav-item">
                <a href="silver.html">
                    <em class="f-ti pic4">白银</em>
                    <span>白银</span>
                </a>
            </div>

            <div class="rank-list-nav-item">
                <a href="finance.html">
                    <em class="f-ti pic5">财经</em>
                    <span>财经</span>
                </a>
            </div>

        </div>
        <div class="rank-list-con">
            <ul class="rank-list-con-title f-cb">
                <li>直播室</li>
                <li>主题</li>
                <li>状态</li>
            </ul>
            <span id="liveList">
            </span>
            <!--<div class="m-page">
                <div>
                    <span class="current">1</span>
                    <a class="num" href="http://www.shagualicai.cn/rank/index-type-5-p-2.shtml">2</a>
                    <a class="num" href="http://www.shagualicai.cn/rank/index-type-5-p-3.shtml">3</a>
                    <a class="num" href="http://www.shagualicai.cn/rank/index-type-5-p-4.shtml">4</a>
                    <a class="next" href="http://www.shagualicai.cn/rank/index-type-5-p-2.shtml">下一页</a>
                </div>
            </div>-->
        </div>
    </div>

</div>
<script>
    $(function () {
        window.onscroll = function () {
            var singleToTop = document.documentElement.scrollTop || document.body.scrollTop;
            if (singleToTop > 320) {
                $(".side-bar").css('height', '267px');
            }
            else {
                $(".side-bar").css('height', '231px');
            }
        }

        $('.side-top').click(function () {
            $("html,body").animate({
                scrollTop: "-100px"
            }, 500);
        });
    });
</script>
<div class="my-footer f-cb" style="border-top: 1px #999 solid; width: 1090px; margin: 0 auto;">
    <div style="font-size:14px;text-align:center">@2016-2017 版权所有 牛牛直播,最专业的财经直播&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;客服电话：400-1088-197</div>
</div>
<div style="background: #fff;">
    <div class="g-doc f-tac my-bottom">
        <span>权威机构安全认证</span>
        <a href="javascript:void(0)" target="_blank">
            <img src="index/report2.jpg" alt="不良信息举报中心">
        </a>
        <a href="javascript:void(0)" target="_blank">
            <img src="index/report3.jpg" alt="360网站安全检测">
        </a>
        <a href="javascript:void(0)" target="_blank">
            <img src="index/report4.jpg" alt="网信认证">
        </a>
        <a href="javascript:void(0)" target="_blank">
            <img src="index/report5.jpg" alt="诚信网站">
        </a>
    </div>
</div>



<script>
    $(function () {
        //列表左右高度相等
        (function () {
            var $rankListCon = $(".rank-list-con");
            var $rankListNav = $(".rank-list-nav");
            if ($rankListCon.height() > $rankListNav.height()) {
                $rankListNav.height($rankListCon.height());
            }
        })();

        //截取摘要30字符
        (function () {
            var $rankListConDes = $(".rank-list-con-des");
            for (var i = 0; i < $rankListConDes.length; i++) {
                var $_text = $rankListConDes.eq(i).text();
                if ($_text.length > 30) {
                    $rankListConDes.eq(i).text($_text.substring(0, 30) + ". . .")
                }
            }
        })()
    })
</script>


</body>
</html>